package com.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.domain.ModelName;
import com.domain.Role;
import com.domain.User;

@Repository
public class UserDao extends BaseDao{
	@SuppressWarnings("unchecked")
	public List<Role> getAllRoles() {
		try {
			return sqlMapClient.queryForList("selectAllRoles");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	public int checkUser(User user){
		Integer result =0;
		try {
		  result = (Integer)sqlMapClient.queryForObject("isExistUser",user);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return result.intValue();
	}
	public List<ModelName> getAllModelNames(){
		try {
			return sqlMapClient.queryForList("selectAllNames");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
}
